#include "StdAfx.h"
#include "RegisterUser.h"
#include "UserAlreadyExist.h"

RegisterUser::RegisterUser( string userName, string password )
{
	this->userName = userName;
	this->password = password;
}


RegisterUser::~RegisterUser(void)
{
}

bool RegisterUser::doAction(UserCollection& uc, MeetingCollection& mc)
{
	if(uc.hasUser(userName))
		throw UserAlreadyExist();		//guard,don't let a exist username to be registered
	else
		uc.addUser(userName,password);
		return true;
}
